package com.cec.result;

import lombok.Getter;

@Getter
public enum ResultCode {

    /**
     * 请求成功
     */
    SUCCESS(0, "请求成功"),

    UNKNOWN(1000, "未知异常"),

    FAIL(1001, "操作失败"),

    LOGIN_FAILURE(2000, "登陆失败"),

    NOT_LOGIN(2001, "未登陆, 请先登陆"),

    TOKEN_EXPIRED(2002, "token过期, 请重新登陆"),

    LOGIN_ERROR(2003, "登陆处理异常"),

    ACCOUNT_STATUS_ABNORMAL(2004, "账号异常"),

    BAD_CREDENTIALS(2005, "用户名或密码错误"),

    ACCOUNT_NOT_FOUND(2006, "用户不存在"),

    INVALID_TOKEN(2007, "无效token"),

    USER_PRESENCE(2008, "用户存在"),

    USER_ERROR(2009, "用户错误"),

    CATEGORY_ERROR(2010, "类别已存在"),

    AUTH_FAILURE(3000, "权限不足, 无法完成操作"),

    RESOURCE_ERROR(4000, "资源操作失败"),

    PARAM_ID_NOT_EXIST(5001, "指定 id 不存在"),

    PARAM_ERROR(5002, "参数异常, 请检查参数"),

    REQUEST_METHOD_ERROR(5003, "请求方法错误"),

    REQUEST_BODY_MISS_ERROR(5004, "缺少Request Body"),

    DATA_LOADING_ERROR(5005, "数据加载错误"),

    OPERATION_DATA_ERROR(5006, "数据操作错误"),

    CONFIG_ERROR(6001, "配置解析异常, 请系统管理员检查配置项"),

    SPLASH_ERROR(6002, "未配置广告"),
    ;


    /**
     * 响应码
     */
    private final Integer code;

    /**
     * 消息
     */
    private final String msg;

    ResultCode(Integer code, String msg) {
        this.msg = msg;
        this.code = code;
    }
}
